package com.zjw.zy.coreui.fragment.holder

import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.zjw.zy.R
import com.zjw.zy.base.BaseViewHolder
import com.zjw.zy.bean.HourlyWeather
import com.zjw.zy.utils.ResourcesUtils
import com.zjw.zy.utils.WeatherUtils

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/10/12 14:30
 */
class WeatherHourHolder(itemView: View) : BaseViewHolder<HourlyWeather>(itemView) {

    private val mDate: TextView by lazy { findViewById(R.id.weather_hour_list_date) }
    private val mIcon: ImageView by lazy { findViewById(R.id.weather_hour_list_icon) }
    private val mTemp: TextView by lazy { findViewById(R.id.weather_hour_list_temp) }

    override fun onBindListener() {

    }

    override fun onBindData(data: HourlyWeather) {
        mDate.text = data.time
        mTemp.text = ResourcesUtils.getString(R.string.main_weather_temp_text, data.tempFc)
        mIcon.setImageDrawable(WeatherUtils.getWeatherIcon(data))
    }

}